package ezXpns.storage;

import java.util.UUID;

/**
 * Interface for storage listeners.
 * They are informed of different events of the storage
 * 
 * @param <T> the value type
 */

//@author A0088827L
public interface StorageListener<T> {
	/**
	 * Triggered <b>after</b> an object is added
	 * @param id id of the object being added
	 * @param obj the object being added
	 */
	public void onAdd(UUID id, T obj);
	
	/**
	 * Triggered <b>after</b> an object is removed <br />
	 * @param id id of the object being removed
	 * @param obj the object being removed
	 */
	public void onRemove(UUID id, T obj);
	
	/**
	 * Triggered <b>after</b> an object is replaced <br />
	 * @param id id of the object being replaced
	 * @param oldObj the old object
	 * @param newObj the new object
	 */
	public void onReplace(UUID id, T oldObj, T newObj);
}
